#include <stdio.h>
#include <stdlib.h>

#define SIZE 	15

#define TRUE 	1
#define FALSE	0

void primeNumber(char *);

int
main()
{
	char	sieve[SIZE];

	primeNumber(sieve);
/*

	char	*sp;
	int 	i, j;

	for (i = 2; i < SIZE; i++)
		sieve[i] = TRUE;

	for (i = 2; i < SIZE; i++) {
		if (sieve[i])
			for (j = i; j * i < SIZE; j++) {
				sieve[i * j] = FALSE;
			}
	}

	for (i = 2; i < SIZE; i++) {
		if (sieve[i])
			printf("%d,  ", i);
	}
	printf("\n");

	*/

	
	return 0;
}


void primeNumber(char *prime)
{
	char 	*sp = prime;
	int		number;

	for (sp = prime; sp < prime + SIZE; sp++) {
		*sp++ = TRUE;
	}

	for (number = 3; ; number += 2) {
		sp = prime + (number - 3)/2;
		if (sp >= &prime[SIZE])
			break;
		while(sp += number, sp < &prime[SIZE])
			*sp = FALSE;
	}

	for (number = 0, sp = prime; sp < &prime[SIZE];
		number += 1, sp++) {
		if (*sp)
			printf("%d\n", number);
	}
}